import request from '../../../utils/request.js'

// 登录
export const login = (data) => {
    return request({
        url: '/user/login',
        method: 'POST',
        data,
    })
}

// 新增
export const userAdd = (data) => {
    return request({
        url: '/user/add',
        method: 'POST',
        data,
    })
}

// 编辑
export const userUpdate = (data) => {
    return request({
        url: '/user/update',
        method: 'POST',
        data,
    })
}

// 删除（可批量）
export const userDelete = (data) => {
    return request({
        url: '/user/delete',
        method: 'POST',
        data,
    })
}

// 所有用户列表
export const userAllList = () => {
    return request({
        url: '/user/allList',
        method: 'GET',
    })
}

// 列表
export const userList = (params) => {
    return request({
        url: '/user/list',
        method: 'GET',
        params,
    })
}

// 用户对应的权限菜单/按钮
export const userPermissions = () => {
    return request({
        url: '/user/permissions',
        method: 'GET',
    })
}